﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MethodWorx.CMS.Plugins
{
    [Serializable]
    public class PlainTextPropertyDetails : ICustomPropertyDetails
    {
        public bool Multiline { get; set; }
        public string Value { get; set; }

        public override string ToString()
        {
            return this.Value;
        }

        public void CopyValueFrom(ICustomPropertyDetails from)
        {
            if(from is PlainTextPropertyDetails)
                this.Value = ((PlainTextPropertyDetails)from).Value;
        }

        #region ICustomPropertyDetails Members


        public void Parse(string input)
        {
            this.Value = input;
        }

        #endregion

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        public bool IsNull()
        {
            return this.Value == null;
        }

        public bool IsEmpty()
        {
            return this.Value == "";
        }
    }
}
